package uk.gov.swmprobation.swm;


import android.app.Activity;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.view.Menu;
import android.view.Window;
import android.widget.TextView;

public class About extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
        setContentView(R.layout.activity_about);
        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title_bar);
        try {
			String versionName = this.getPackageManager().getPackageInfo(this.getPackageName(), 0 ).versionName;
			TextView version = (TextView) findViewById(R.id.app_version);
	        version.setText("Version: " + versionName);
		} catch (NameNotFoundException e) {
			TextView version = (TextView) findViewById(R.id.app_version);
	        version.setText("Version data not found");
		}
        
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_about, menu);
        return true;
    }
}
